package com.itheima.service.Impl;

import com.itheima.domain.Trip;
import com.itheima.mapper.TripMapper;
import com.itheima.service.TripService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TripServiceImpl implements TripService {

    @Autowired
    TripMapper tripMapper;

    public List<Trip> findAll() {
        List<Trip> list = tripMapper.findAll();
        return list;
    }

    public void addTrip(Trip trip) {
        tripMapper.addTrip(trip);
    }

    public Trip findById(Long id) {
        return tripMapper.findById(id);
    }

    public void updateTripById(Trip trip) {
        tripMapper.updateTripById(trip);
    }

    public void deleteTripById(Long id) {
        tripMapper.deleteTripById(id);
    }
}
